Skip to content

Conversation

@pokornyd
Copy link
Member

Motivation

Fixes #111 #112

Checklist

  • Code follows coding conventions held in this repo
  • Automated tests have been added
  • Tests are passing
  • Docs have been updated (if applicable)
  • Temporary settings (e.g. variables used during development and testing) have been reverted to defaults

How to test

If manual testing is required, what are the steps?

@pokornyd pokornyd linked an issue Sep 26, 2025 that may be closed by this pull request
private readonly IDeliveryCacheManager _cacheManager;

public WebhooksController(IDeliveryCacheManager cacheManager)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep the original constructor, rather then using this hybrid solution for field validation. but it is up to your decision.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might be right, especially since rest of the project doesn't use primary constructors either. reverting.


[HttpPost]
public async Task<IActionResult> Index([FromBody] DeliveryWebhookModel model)
public async Task<IActionResult> Index([FromBody] WebhookNotification? webhook)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we support both until the 1.11.? or is it ok to cause this breaking now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the underlying package is https://github.com/kontent-ai/aspnetcore-extensions and it still supports legacy webhooks as well. the boilerplate should ideally use the most up-to-date approach and since we'll be removing legacy webhooks soon, I don't see a problem with adopting the new webhooks (wouldn't want users to scaffold a new project with webhooks that won't be a thing in a month).

dependencies.Add(CacheHelpers.GetItemDependencyKey(item.Codename));
}

dependencies.Add(CacheHelpers.GetItemsDependencyKey());
Copy link
Contributor

@sevcik-martin sevcik-martin Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about items dependencyKey?
also when there is taxonomy update, there were other dependecies as well.
Current webhooks do not include info about touched dependencies though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this was way too simple. I added more complex logic with pattern matching to wipe the keys of (potentially) dependent entities

return Ok();
}

private static string? GetDependencyKey(WebhookModel notification) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this same for every webhook model?

@pokornyd pokornyd merged commit 6042591 into master Oct 8, 2025
1 check passed
@pokornyd pokornyd deleted the 111-112-update branch October 8, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to use the new Webhook platform? Update to latest Nugets and .NET 8

4 participants